<?php
namespace Game\Module;
use Game\Traits\Singleton;
use \GatewayWorker\Lib\Gateway;
use Game\Config\Config;

class Verificate
{
	

	use Singleton;


    /**
     * 获取实例
     * @param int $account_id
     * @param string $session
     * @return bool
     */
    public function checkRequestSession($account_id=-1, $session="")
    {
//        return array("result"=>CodeConst::Check_Session_Failed,"operation"=>$operation,"data"=>array(),"result_message"=>"玩家登录失效");
	    return true;
        $dealer_num = Config::Dealer_Num;
        //$type = Game::Game_Type;
        $type = "";
        $ver_code = Config::Verification_Code;

        $check_session = base64_encode(md5($account_id.$dealer_num.$ver_code.$type));

        //var_dump($session);
        //var_dump($check_session);

        if($session != $check_session)
        {
            Logger::getInstance()->error("function(checkRequestSession):session error: account:".$account_id.";session:".$session.";checksession:".$check_session." in file".__FILE__." on Line ".__LINE__);

            $msg = json_encode(array("result"=>"-201","result_message"=>"请求错误")); 
            Gateway::sendToCurrentClient($msg);

            //关闭当前链接
            //Gateway::closeCurrentClient();
            return false;
        }

        return true;
    }

}
